import axiosApi from "./AxiosApi.js";

const sampleQuerys = {
  // 搜索样本分页查询
  page: {
    url: `/xssc/searchSample/pageSample`,
    method: "POST"
  },
  // 获取实验项目列表
  listExperimentBy: {
    url: `/searchSample/listExperimentBySampleId`,
    method: "GET"
  },
  // 导入Excel
  importSample: {
    url: `/xssc/searchSample/importSample`,
    method: "POST"
  },
  // 列表+展开
  getNotBankExperimentsById: {
    url: `/xssc/searchSample/getNotBankExperimentsById`,
    method: "GET"
  },
  // 结论+列表
  getExperimentsById: {
    url: `/xssc/searchSample/getExperimentsById`,
    method: "GET"
  },
  // 结论修改
  updateExperimentResult: {
    url: `/xssc/searchSample/updateExperimentResult`,
    method: "PUT"
  },
  // 项目修改
  updateProject: {
    url: `/xssc/searchSample/updateExperimentSample`,
    method: "POST"
  },
  // 修改
  updateSample: {
    url: `/xssc/searchSample/updateSample`,
    method: "POST"
  },
  // 删除
  delete: {
    url: `/xssc/searchSample`,
    method: "DELETE"
  },
  // 导出
  export: {
    url: `/xssc/searchSample/export`,
    method: "POST",
  },

};

const reportQuery = {
  // 报告分页查询
  page: {
    url: `/xssc/searchReport/pageSample`,
    method: "POST"
  },
  // 展开+列表
  getExperimentsById: {
    url: `/xssc/searchReport/getExperimentsById`,
    method: "GET"
  },
  // 打印次数增加
  addPrintQuantity: {
    url: `/xssc/searchReport/addPrintQuantity`,
    method: "GET"
  },
  // 打印详情
  printReport: {
    url: `/xssc/searchReport/printReport`,
    method: "POST"
  },
  // 报告详情
  viewReport: {
    url: `/xssc/searchReport/viewReport`,
    method: "GET"
  },
  
};

export default {
  sampleQuerys: {
    page(data) {
      return axiosApi({
        ...sampleQuerys.page,
        // formData: true,
        data
      });
    },
    listExperimentBy(data) {
      return axiosApi({
        ...sampleQuerys.listExperimentBy,
        // formData: true,
        data
      });
    },
    importSample(data) {
      return axiosApi({
        ...sampleQuerys.importSample,
        // formData: true,
        data
      });
    },
    getNotBankExperimentsById(data) {
      return axiosApi({
        ...sampleQuerys.getNotBankExperimentsById,
        // formData: true,
        data
      });
    },
    getExperimentsById(data) {
      return axiosApi({
        ...sampleQuerys.getExperimentsById,
        // formData: true,
        data
      });
    },
    updateExperimentResult(data) {
      return axiosApi({
        ...sampleQuerys.updateExperimentResult,
        // formData: true,
        data
      });
    },
    updateProject(data) {
      return axiosApi({
        ...sampleQuerys.updateProject,
        // formData: true,
        data
      });
    },
    updateSample(data) {
      return axiosApi({
        ...sampleQuerys.updateSample,
        // formData: true,
        data
      });
    },
    delete(data) {
      return axiosApi({
        ...sampleQuerys.delete,
        // formData: true,
        data
      });
    },
    export(data) {
      return axiosApi({
        ...sampleQuerys.export,
        // formData: true,
        responseType: "blob",
        data
      });
    },
  },
  reportQuery: {
    page(data) {
      return axiosApi({
        ...reportQuery.page,
        // formData: true,
        data
      });
    },
    getExperimentsById(data) {
      return axiosApi({
        ...reportQuery.getExperimentsById,
        // formData: true,
        data
      });
    },
    addPrintQuantity(data) {
      return axiosApi({
        ...reportQuery.addPrintQuantity,
        // formData: true,
        data
      });
    },
    printReport(data) {
      return axiosApi({
        ...reportQuery.printReport,
        // formData: true,
        data
      });
    },
    viewReport(data) {
      return axiosApi({
        ...reportQuery.viewReport,
        // formData: true,
        data
      });
    },
  }
};
